﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace SmartDeviceProject2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {

        }

        private void textBox1_TextChanged(object sender, EventArgs e) {

        }

        private void menuItem5_Click(object sender, EventArgs e) {
            openFileDialog1.ShowDialog();
            MessageBox.Show(openFileDialog1.FileName);            
        }

        private void menuItem1_Click(object sender, EventArgs e) {

   




        }
        String a = "";
        int b = 0;
        private void menuItem6_Click(object sender, EventArgs e) {
            a = textBox1.SelectedText;
            b = textBox1.SelectionStart;
            textBox1.SelectedText = "";
            MessageBox.Show(a);
            
        }

        private void menuItem2_Click(object sender, EventArgs e) {
            textBox1.Select(3, 3);
            textBox1.Select(8, 8);
            Label l = new Label();
            l.Show();
            l.Text = "aaaaaaaaaaaaaaaaaaaaaaaa";
            l.ForeColor = Color.Red;
            
            

        }

        private void listView1_SelectedIndexChanged(object sender, EventArgs e) {
            
        }

        private void listView1_ItemCheck(object sender, ItemCheckEventArgs e) {

            MessageBox.Show(e.Index.ToString());
            if (e.Index == 1) {
                textBox1.Focus();
                textBox1.Select(3, 3);
            }

        }

        private void button1_Click(object sender, EventArgs e) {
            TreeNode t = new TreeNode();
            t.Text = "aaaa";
            
            TreeNode child = new TreeNode();
            child.Text = "child";

            TreeNode child1 = new TreeNode();
            child1.Text = "child1";

            child.Nodes.Add(child1);
            child.Nodes.Add("child2");
            t.Nodes.Add(child);
            
            treeView1.Nodes.Add(t);
            treeView1.Nodes.Add("bb");
        }
        bool abc = false;
        private void Form1_MouseMove(object sender, MouseEventArgs e) {
            if (abc) {
                textBox1.Text = e.X + " :: " + e.Y;
                panel1.Location = new Point(e.X, e.Y);
            }

        }
        
        private void panel1_MouseDown(object sender, MouseEventArgs e) {
            
            abc = true;
            
        }

        private void panel1_MouseMove(object sender, MouseEventArgs e) {

        }

        private void panel1_MouseUp(object sender, MouseEventArgs e) {
           

        }

        private void Form1_MouseUp(object sender, MouseEventArgs e) {
            abc = false;
        }
    }
}